﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Data.Objects;
using System.Linq;

namespace LinqBll
{
    public interface ICore<T> : IDisposable
        where T : class
    {
        void CreateList(IEnumerable<T> ts);
        void Create(T t);
        void Delete(IEnumerable<T> ts);
        void Delete(T t);
        void Update(IEnumerable<T> ts);
        void Update(T t);
        T Query(Func<T, bool> func);
        IList<T> Select(int start, int limit);

        IQueryable<T> QueryList();
        IQueryable<T> QueryList(Func<T, bool> func);
        IQueryable<T> QueryList(Func<T, int, bool> func);
        void SaveChanges();
    }
    public interface IObjectSetCore<T> : ICore<T>
        where T : class
    {
        ObjectSet<T> ObjectSet { get; } //System.Data.Entity.dll

    }
    public interface ITableCore<T> : ICore<T>
        where T : class
    {
        Table<T> Table { get; }
    }
}
